/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package IDandEMAIL;

/**
 *
 * @author Administrator
 */
public class Email {

    public static void main(String[] args) {
        String email = "javatanjun2010@gmail.com";
        boolean flag = true;



        if (email.length()
                < 5) {
            flag = false;
        }
        if(!(email.endsWith(".com"))){
              flag=false;    
        }
        String string="abcdefghijklmnopqrstuvwxyz0123456789";
        for(int i=0;i<email.length();i++){
            char c=email.charAt(i);
            int temp=string.indexOf(c);
            if(temp<0){
               flag=false;
               break;
            }
        }
        if(flag){
            System.out.println("是合法的email");
        }else{
            System.out.println("不是合法的email");
        }
        
        
        
    }
}
